package com.monkey.model.monkey;

/**
 * desc:
 * auth: chenxiaobin
 * data: 2018/1/13.
 */
public class MonkeyTradeData {
    private int monkeyId;
    private int generation;
    private int weight;
    private int grow;
    private int reproduct;
    private int bonus;
    private int repoductCount;
    private String uuid;
    private int userId;
    private float price;
    private int element;

    // 给redis用的，不能删
    public MonkeyTradeData() {
    }

    public MonkeyTradeData(Monkey monkey, int userId, float price) {
        this.monkeyId = monkey.getId();
        this.generation = monkey.getGeneration();
        this.weight = monkey.getWeight();
        this.grow = monkey.getGrow();
        this.reproduct = monkey.getReproduct();
        this.bonus = monkey.getBonus();
        this.repoductCount = monkey.getReproductCount();
        this.uuid = monkey.getUuid();
        this.userId = userId;
        this.price = price;
        this.element = monkey.getElement();
    }

    public int getMonkeyId() {
        return monkeyId;
    }

    public int getGeneration() {
        return generation;
    }

    public float getWeight() {
        return weight * 1.0f / 100;
    }

    public float getGrow() {
        return grow * 1.0f / 100;
    }

    public float getReproduct() {
        return reproduct * 1.0f / 100;
    }

    public float getBonus() {
        return bonus * 1.0f / 100;
    }

    public int getRepoductCount() {
        return repoductCount;
    }

    public String getUuid() {
        return uuid;
    }

    public int getUserId() {
        return userId;
    }

    public float getPrice() {
        return price;
    }
    
    public int getElement() {
        return element;
    }

    // 以下仅供redis反序列化使用
    public void setMonkeyId(int monkeyId) {
        this.monkeyId = monkeyId;
    }

    public void setGeneration(int generation) {
        this.generation = generation;
    }

    public void setWeight(float weight) {
        this.weight = (int) (weight * 100);
    }

    public void setGrow(float grow) {
        this.grow = (int) (grow * 100);
    }

    public void setReproduct(float reproduct) {
        this.reproduct = (int) (reproduct * 100);
    }

    public void setBonus(float bonus) {
        this.bonus = (int) (bonus * 100);
    }

    public void setRepoductCount(int repoductCount) {
        this.repoductCount = repoductCount;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public void setPrice(float price) {
        this.price = price;
    }
    
    public void setElement(int element) {
        this.element = element;
    }
}
